/*
 * 闰年相关的问题v3.0——计算有多少闰年（4分）
 *
 * v1.0，见：04-week04/2_Whether_Leap_Year_Or_Not.c
 * v2.0，见：06-week06/9_Output_How_Many_Days_Do_A_Month_Has_with_Leap_Year_Considered.c
 */

#include <stdio.h>

int main() {
	setbuf(stdout, NULL);

	// NOTE: Variable declaration
	int birth_year, this_year;

	// 计数器，用于统计闰年个数
	int count = 0;

	// NOTE: Inputs
	printf("Input your birth year:");
	scanf("%d", &birth_year);

	printf("Input this year:");
	scanf("%d", &this_year);


	// NOTE: Process

	// NOTE: Outputs
	for (int i = birth_year; i <= this_year; ++i) {
		if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) {
			printf("%d\n", i);
			++count;
		}
	}

	printf("count=%d\n", count);


	// NOTE: Ending
	return 0;
}